/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package boundless.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author hendrikdekock
 */
@Entity
@Table(name = "STATS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Stats.findAll", query = "SELECT s FROM Stats s"),
    @NamedQuery(name = "Stats.findByPlayerid", query = "SELECT s FROM Stats s WHERE s.playerid = :playerid"),
    @NamedQuery(name = "Stats.findByConversions", query = "SELECT s FROM Stats s WHERE s.conversions = :conversions"),
    @NamedQuery(name = "Stats.findByFumblesrecoveredtouchdowns", query = "SELECT s FROM Stats s WHERE s.fumblesrecoveredtouchdowns = :fumblesrecoveredtouchdowns"),
    @NamedQuery(name = "Stats.findByFumbleslost", query = "SELECT s FROM Stats s WHERE s.fumbleslost = :fumbleslost"),
    @NamedQuery(name = "Stats.findByInterceptionslost", query = "SELECT s FROM Stats s WHERE s.interceptionslost = :interceptionslost"),
    @NamedQuery(name = "Stats.findByPassingtouchdowns", query = "SELECT s FROM Stats s WHERE s.passingtouchdowns = :passingtouchdowns"),
    @NamedQuery(name = "Stats.findByPassingyards", query = "SELECT s FROM Stats s WHERE s.passingyards = :passingyards"),
    @NamedQuery(name = "Stats.findByReceivingtouchdowns", query = "SELECT s FROM Stats s WHERE s.receivingtouchdowns = :receivingtouchdowns"),
    @NamedQuery(name = "Stats.findByReceivingyards", query = "SELECT s FROM Stats s WHERE s.receivingyards = :receivingyards"),
    @NamedQuery(name = "Stats.findByRushingtouchdowns", query = "SELECT s FROM Stats s WHERE s.rushingtouchdowns = :rushingtouchdowns"),
    @NamedQuery(name = "Stats.findByRushingyards", query = "SELECT s FROM Stats s WHERE s.rushingyards = :rushingyards"),
    @NamedQuery(name = "Stats.findByDefensivetouchdowns", query = "SELECT s FROM Stats s WHERE s.defensivetouchdowns = :defensivetouchdowns"),
    @NamedQuery(name = "Stats.findByFumblesrecovered", query = "SELECT s FROM Stats s WHERE s.fumblesrecovered = :fumblesrecovered"),
    @NamedQuery(name = "Stats.findByInterceptionswon", query = "SELECT s FROM Stats s WHERE s.interceptionswon = :interceptionswon"),
    @NamedQuery(name = "Stats.findByKickpuntreturntouchdowns", query = "SELECT s FROM Stats s WHERE s.kickpuntreturntouchdowns = :kickpuntreturntouchdowns"),
    @NamedQuery(name = "Stats.findByPointsallowed", query = "SELECT s FROM Stats s WHERE s.pointsallowed = :pointsallowed"),
    @NamedQuery(name = "Stats.findBySacks", query = "SELECT s FROM Stats s WHERE s.sacks = :sacks"),
    @NamedQuery(name = "Stats.findBySafeties", query = "SELECT s FROM Stats s WHERE s.safeties = :safeties"),
    @NamedQuery(name = "Stats.findByFieldgoal", query = "SELECT s FROM Stats s WHERE s.fieldgoal = :fieldgoal"),
    @NamedQuery(name = "Stats.findByFieldgoal50", query = "SELECT s FROM Stats s WHERE s.fieldgoal50 = :fieldgoal50"),
    @NamedQuery(name = "Stats.findByPointsaftertouchdown", query = "SELECT s FROM Stats s WHERE s.pointsaftertouchdown = :pointsaftertouchdown")})
public class Stats implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "PLAYERID")
    private Integer playerid;
    @Column(name = "CONVERSIONS")
    private Integer conversions;
    @Column(name = "FUMBLESRECOVEREDTOUCHDOWNS")
    private Integer fumblesrecoveredtouchdowns;
    @Column(name = "FUMBLESLOST")
    private Integer fumbleslost;
    @Column(name = "INTERCEPTIONSLOST")
    private Integer interceptionslost;
    @Column(name = "PASSINGTOUCHDOWNS")
    private Integer passingtouchdowns;
    @Column(name = "PASSINGYARDS")
    private Integer passingyards;
    @Column(name = "RECEIVINGTOUCHDOWNS")
    private Integer receivingtouchdowns;
    @Column(name = "RECEIVINGYARDS")
    private Integer receivingyards;
    @Column(name = "RUSHINGTOUCHDOWNS")
    private Integer rushingtouchdowns;
    @Column(name = "RUSHINGYARDS")
    private Integer rushingyards;
    @Column(name = "DEFENSIVETOUCHDOWNS")
    private Integer defensivetouchdowns;
    @Column(name = "FUMBLESRECOVERED")
    private Integer fumblesrecovered;
    @Column(name = "INTERCEPTIONSWON")
    private Integer interceptionswon;
    @Column(name = "KICKPUNTRETURNTOUCHDOWNS")
    private Integer kickpuntreturntouchdowns;
    @Column(name = "POINTSALLOWED")
    private Integer pointsallowed;
    @Column(name = "SACKS")
    private Integer sacks;
    @Column(name = "SAFETIES")
    private Integer safeties;
    @Column(name = "FIELDGOAL")
    private Integer fieldgoal;
    @Column(name = "FIELDGOAL50")
    private Integer fieldgoal50;
    @Column(name = "POINTSAFTERTOUCHDOWN")
    private Integer pointsaftertouchdown;
    @JoinColumn(name = "PLAYERID", referencedColumnName = "ID", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Player player;

    public Stats() {
    }

    public Stats(Integer playerid) {
        this.playerid = playerid;
    }

    public Integer getPlayerid() {
        return playerid;
    }

    public void setPlayerid(Integer playerid) {
        this.playerid = playerid;
    }

    public Integer getConversions() {
        return conversions;
    }

    public void setConversions(Integer conversions) {
        this.conversions = conversions;
    }

    public Integer getFumblesrecoveredtouchdowns() {
        return fumblesrecoveredtouchdowns;
    }

    public void setFumblesrecoveredtouchdowns(Integer fumblesrecoveredtouchdowns) {
        this.fumblesrecoveredtouchdowns = fumblesrecoveredtouchdowns;
    }

    public Integer getFumbleslost() {
        return fumbleslost;
    }

    public void setFumbleslost(Integer fumbleslost) {
        this.fumbleslost = fumbleslost;
    }

    public Integer getInterceptionslost() {
        return interceptionslost;
    }

    public void setInterceptionslost(Integer interceptionslost) {
        this.interceptionslost = interceptionslost;
    }

    public Integer getPassingtouchdowns() {
        return passingtouchdowns;
    }

    public void setPassingtouchdowns(Integer passingtouchdowns) {
        this.passingtouchdowns = passingtouchdowns;
    }

    public Integer getPassingyards() {
        return passingyards;
    }

    public void setPassingyards(Integer passingyards) {
        this.passingyards = passingyards;
    }

    public Integer getReceivingtouchdowns() {
        return receivingtouchdowns;
    }

    public void setReceivingtouchdowns(Integer receivingtouchdowns) {
        this.receivingtouchdowns = receivingtouchdowns;
    }

    public Integer getReceivingyards() {
        return receivingyards;
    }

    public void setReceivingyards(Integer receivingyards) {
        this.receivingyards = receivingyards;
    }

    public Integer getRushingtouchdowns() {
        return rushingtouchdowns;
    }

    public void setRushingtouchdowns(Integer rushingtouchdowns) {
        this.rushingtouchdowns = rushingtouchdowns;
    }

    public Integer getRushingyards() {
        return rushingyards;
    }

    public void setRushingyards(Integer rushingyards) {
        this.rushingyards = rushingyards;
    }

    public Integer getDefensivetouchdowns() {
        return defensivetouchdowns;
    }

    public void setDefensivetouchdowns(Integer defensivetouchdowns) {
        this.defensivetouchdowns = defensivetouchdowns;
    }

    public Integer getFumblesrecovered() {
        return fumblesrecovered;
    }

    public void setFumblesrecovered(Integer fumblesrecovered) {
        this.fumblesrecovered = fumblesrecovered;
    }

    public Integer getInterceptionswon() {
        return interceptionswon;
    }

    public void setInterceptionswon(Integer interceptionswon) {
        this.interceptionswon = interceptionswon;
    }

    public Integer getKickpuntreturntouchdowns() {
        return kickpuntreturntouchdowns;
    }

    public void setKickpuntreturntouchdowns(Integer kickpuntreturntouchdowns) {
        this.kickpuntreturntouchdowns = kickpuntreturntouchdowns;
    }

    public Integer getPointsallowed() {
        return pointsallowed;
    }

    public void setPointsallowed(Integer pointsallowed) {
        this.pointsallowed = pointsallowed;
    }

    public Integer getSacks() {
        return sacks;
    }

    public void setSacks(Integer sacks) {
        this.sacks = sacks;
    }

    public Integer getSafeties() {
        return safeties;
    }

    public void setSafeties(Integer safeties) {
        this.safeties = safeties;
    }

    public Integer getFieldgoal() {
        return fieldgoal;
    }

    public void setFieldgoal(Integer fieldgoal) {
        this.fieldgoal = fieldgoal;
    }

    public Integer getFieldgoal50() {
        return fieldgoal50;
    }

    public void setFieldgoal50(Integer fieldgoal50) {
        this.fieldgoal50 = fieldgoal50;
    }

    public Integer getPointsaftertouchdown() {
        return pointsaftertouchdown;
    }

    public void setPointsaftertouchdown(Integer pointsaftertouchdown) {
        this.pointsaftertouchdown = pointsaftertouchdown;
    }

    public Player getPlayer() {
        return player;
    }

    public void setPlayer(Player player) {
        this.player = player;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (playerid != null ? playerid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Stats)) {
            return false;
        }
        Stats other = (Stats) object;
        if ((this.playerid == null && other.playerid != null) || (this.playerid != null && !this.playerid.equals(other.playerid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "boundless.entities.Stats[ playerid=" + playerid + " ]";
    }
    
}
